﻿<navigation:Page x:Class="BidiControls_Tester.Views.Arabic" 
           xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"  
           xmlns:twilightBlue="clr-namespace:System.Windows.Controls.Theming;assembly=System.Windows.Controls.Theming.TwilightBlue"  
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           xmlns:bidi="clr-namespace:System.Windows.BidiControls;assembly=BidiControls"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="640" d:DesignHeight="480"
           Title="الصفحة العربية"
           Style="{StaticResource PageStyle}">
    <Grid x:Name="LayoutRoot">
    <Grid.Resources>
      <Style TargetType="bidi:TextBlock" x:Name="BigArabicText">
        <Setter Property="FontSize" Value="15"/>
      </Style>
      <Style TargetType="bidi:TextBox" x:Name="BigArabicTextBox">
        <Setter Property="FontSize" Value="15"/>
      </Style>
        <Style TargetType="TextBlock" x:Name="BigText">
        <Setter Property="FontSize" Value="15"/>
      </Style>
      <Style TargetType="bidi:Button" x:Name="BigArabicButton">
        <Setter Property="FontSize" Value="15"/>
      </Style>
      <Style TargetType="bidi:ToggleButton" x:Name="BigArabicToggleButton">
        <Setter Property="FontSize" Value="15"/>
      </Style>
      <Style TargetType="bidi:TabItem" x:Name="BigArabicTabItem">
        <Setter Property="FontSize" Value="15"/>
      </Style>
      <Style TargetType="controls:TabItem" x:Name="BigTabItem">
        <Setter Property="FontSize" Value="15"/>
      </Style>
      
      <DataTemplate x:Name="bidiComplexData">
        <StackPanel Orientation="Vertical">
          <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
            <bidi:TextBlock Text="{Binding FirstName}" Style="{StaticResource BigArabicText}"/>
            <bidi:TextBlock Text=" "/>
            <bidi:TextBlock Text="{Binding LastName}"  Style="{StaticResource BigArabicText}"/>
          </StackPanel>
          <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
            <TextBlock Text="{Binding ID}"/>
            <bidi:TextBlock Text="رقم الهوية : " Style="{StaticResource BigArabicText}" Width="200"/>
          </StackPanel>
          <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
            <bidi:DatePicker SelectedDate="{Binding Birthday}" FirstDayOfWeek="Sunday" IsEnabled="False"/>
            <bidi:TextBlock Text="عيد الميلاد : " Style="{StaticResource BigArabicText}" Width="200"/>
          </StackPanel>
        </StackPanel>
      </DataTemplate>

      <DataTemplate x:Name="nonBidiComplexData">
        <StackPanel Orientation="Vertical">
          <StackPanel Orientation="Horizontal">
            <TextBlock Text="{Binding FirstName}"/>
            <TextBlock Text=" "/>
            <TextBlock Text="{Binding LastName}"/>
          </StackPanel>
          <StackPanel Orientation="Horizontal">
            <TextBlock Text="رقم الهوية : " Width="200"/>
            <TextBlock Text="{Binding ID}"/>
          </StackPanel>
          <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
            <TextBlock Text="عيد الميلاد : " Width="200"/>
            <controls:DatePicker SelectedDate="{Binding Birthday}" FirstDayOfWeek="Sunday" IsEnabled="False"/>
          </StackPanel>
        </StackPanel>
      </DataTemplate>

      <DataTemplate x:Name="bidiSimpleData">
        <bidi:TextBlock Text="{Binding}" Width="200" Style="{StaticResource BigArabicText}"/>
      </DataTemplate>

      <DataTemplate x:Name="nonBidiSimpleData">
        <TextBlock Text="{Binding}" Width="200" />
      </DataTemplate>
    </Grid.Resources>

    <!--<twilightBlue:TwilightBlueTheme>-->

    <ScrollViewer x:Name="PageScrollViewer" Style="{StaticResource PageScrollViewerStyle}">

      <StackPanel x:Name="ContentStackPanel">

        <bidi:TextBlock x:Name="HeaderText" Style="{StaticResource BidiHeaderTextStyle}" 
                                   Text="ضوابط مع دعم العربية"/>
        <Grid>
          <!--Grid Definitions-->
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="0.3*"/>
            <ColumnDefinition Width="0.3*"/>
            <ColumnDefinition Width="0.3*"/>
          </Grid.ColumnDefinitions>

          <Grid.RowDefinitions>
            <!--Header-->
            <RowDefinition/>
            <!--Button-->
            <RowDefinition/>
            <!--Calendar-->
            <RowDefinition/>
            <!--CheckBox-->
            <RowDefinition/>
            <!--ContentControl-->
            <RowDefinition/>
            <!--DatePicker-->
            <RowDefinition/>
            <!--Hyperlink-->
            <RowDefinition/>
            <!--ListBox-->
            <RowDefinition/>
            <!--RadioButton-->
            <RowDefinition/>
            <!--TabItem-->
            <RowDefinition/>
            <!--TextBox-->
            <RowDefinition/>
            <!--TextBlock-->
            <RowDefinition/>
            <!--ToggleButton-->
            <RowDefinition/>
            <!--DataGrid-->
            <RowDefinition/>
          </Grid.RowDefinitions>

          <!--Header-->
          <TextBlock HorizontalAlignment="Center" Text="Original Control" Grid.Column="0" Style="{StaticResource ContentTextStyle}" Margin="5"/>
          <bidi:TextBlock HorizontalAlignment="Center" Text="الرقابة العربية" Grid.Column="1" Style="{StaticResource BidiContentTextStyle}" Margin="5"/>
          <StackPanel Orientation="Horizontal" Grid.Column="2" Margin="5" HorizontalAlignment="Center">
            <TextBlock Text="Control Text" Style="{StaticResource ContentTextStyle}"/>
            <TextBlock Text=" / " Style="{StaticResource ContentTextStyle}"/>
            <bidi:TextBlock Text="التحكم في النص" Style="{StaticResource BidiContentTextStyle}"/>
          </StackPanel>

          <!--Controls-->

          <!--Button-->
          <bidi:TextBox x:Name="txtButtonText" Text="مرحبا! أنا النص باللغة العربية" FlowDirection="RightToLeft" Grid.Row="1" Grid.Column="2" Style="{StaticResource BigArabicTextBox}"/>
          <bidi:Button x:Name="btnBidiButton" Content="{Binding Path=Text, ElementName=txtButtonText}" Grid.Row="1" Grid.Column="1" Style="{StaticResource BigArabicButton}"/>
          <Button x:Name="btnButton" Content="{Binding Path=Text, ElementName=txtButtonText}" Grid.Row="1" Grid.Column="0"/>

          <!--Calendar-->
          <bidi:Calendar DisplayMode="Month" FirstDayOfWeek="Sunday" SelectionMode="MultipleRange" Grid.Row="2" Grid.Column="1" FontSize="15"/>
          <controls:Calendar DisplayMode="Month" FirstDayOfWeek="Sunday" SelectionMode="MultipleRange" Grid.Row="2" Grid.Column="0" FontSize="15"/>

          <!--CheckBox-->
          <bidi:TextBox x:Name="txtCheckBoxText" Text="مرحبا! أنا النص باللغة العربية" FlowDirection="RightToLeft" Grid.Row="3" Grid.Column="2"  Style="{StaticResource BigArabicTextBox}"/>
          <bidi:CheckBox Content="{Binding Path=Text, ElementName=txtCheckBoxText}" Grid.Row="3" Grid.Column="1" FontSize="15"/>
          <CheckBox Content="{Binding Path=Text, ElementName=txtCheckBoxText}" Grid.Row="3" Grid.Column="0" FontSize="15"/>

          <!--Content Control-->
          <bidi:ContentControl Grid.Row="4" Grid.Column="1" Content="{Binding Path=Content, ElementName=btnBidiButton}" FontSize="15"/>
          <ContentControl Grid.Row="4" Grid.Column="0" Content="{Binding Path=Content, ElementName=btnButton}" FontSize="15"/>

          <!--DatePicker-->
          <bidi:DatePicker FirstDayOfWeek="Sunday"  Grid.Row="5" Grid.Column="1" FontSize="15"/>
          <controls:DatePicker FirstDayOfWeek="Sunday" Grid.Row="5" Grid.Column="0" FontSize="15"/>

          <!--Hyperlink-->
          <bidi:TextBox x:Name="txtHyperlinkText" Text="مرحبا! أنا النص باللغة العربية" FlowDirection="RightToLeft" Grid.Row="6" Grid.Column="2"   Style="{StaticResource BigArabicTextBox}"/>
          <bidi:HyperlinkButton NavigateUri="http://blogs.microsoft.co.il/blogs/alex_golesh" TargetName="_blank" Content="{Binding Path=Text, ElementName=txtHyperlinkText}" Grid.Row="6" Grid.Column="1" FontSize="15"/>
          <HyperlinkButton NavigateUri="http://blogs.microsoft.co.il/blogs/alex_golesh" TargetName="_blank" Content="{Binding Path=Text, ElementName=txtHyperlinkText}" Grid.Row="6" Grid.Column="0" FontSize="15"/>

          <!--ListBox-->
          <StackPanel Orientation="Horizontal" Grid.Row="7" Grid.Column="2" HorizontalAlignment="Right">
            <bidi:Button x:Name="btnFillSimple" Width="130" Height="25" Margin="5,0" Content="ملء بيانات بسيطة" Click="btnFillSimple_Click"  Style="{StaticResource BigArabicButton}"/>
            <bidi:Button x:Name="btnFillComplex" Width="130" Height="25" Margin="5,0" Content="ملء بيانات معقدة" Click="btnFillComplex_Click"  Style="{StaticResource BigArabicButton}"/>
          </StackPanel>
          <bidi:ListBox x:Name="lstBidiListBox" Grid.Row="7" Grid.Column="1" MaxHeight="150" ScrollViewer.VerticalScrollBarVisibility="Auto">
            <bidi:ListBoxItem>
              <bidi:TextBox Text="البند رقم 1"   Style="{StaticResource BigArabicTextBox}"/>
            </bidi:ListBoxItem>
            <bidi:ListBoxItem>
              <bidi:TextBlock Text="البند رقم 2" Width="100" Style="{StaticResource BigArabicText}"/>
            </bidi:ListBoxItem>
            <bidi:ListBoxItem>
              <bidi:Button Content="البند رقم 3" Style="{StaticResource BigArabicButton}"/>
            </bidi:ListBoxItem>
            <bidi:ListBoxItem>
              <bidi:CheckBox Content="البند رقم 4" FontSize="15"/>
            </bidi:ListBoxItem>
            <bidi:ListBoxItem>
              <bidi:RadioButton Content="البند رقم 5"  FontSize="15"/>
            </bidi:ListBoxItem>
          </bidi:ListBox>
          <ListBox x:Name="lstListBox" Grid.Row="7" Grid.Column="0" MaxHeight="150">
            <ListBoxItem>
              <TextBox Text="البند رقم 1"  FontSize="15"/>
            </ListBoxItem>
            <ListBoxItem>
              <TextBlock Text="البند رقم 2" Style="{StaticResource BigText}"/>
            </ListBoxItem>
            <ListBoxItem>
              <Button Content="البند رقم 3" FontSize="15"/>
            </ListBoxItem>
            <ListBoxItem>
              <CheckBox Content="البند رقم 4" FontSize="15"/>
            </ListBoxItem>
            <ListBoxItem>
              <RadioButton Content="البند رقم 5" FontSize="15"/>
            </ListBoxItem>
          </ListBox>

          <!--RadioBox-->
          <bidi:TextBox x:Name="txtRadioButtonText" Text="مرحبا! أنا النص باللغة العربية" FlowDirection="RightToLeft" Grid.Row="8" Grid.Column="2"  Style="{StaticResource BigArabicTextBox}"/>
          <bidi:RadioButton Content="{Binding Path=Text, ElementName=txtRadioButtonText}" Grid.Row="8" Grid.Column="1" FontSize="15"/>
          <RadioButton Content="{Binding Path=Text, ElementName=txtRadioButtonText}" Grid.Row="8" Grid.Column="0" FontSize="15"/>

          <!--TabItem-->
          <controls:TabControl TabStripPlacement="Top" TabNavigation="Cycle" HorizontalAlignment="Right" Grid.Row="9" Grid.Column="1">
            <bidi:TabItem Header="تبويبة رقم 1" Style="{StaticResource BigArabicTabItem}">
              <bidi:TabItem.Content>
                <bidi:TextBlock Text="تبويبة محتوى رقم 1" Style="{StaticResource BigArabicText}"/>
              </bidi:TabItem.Content>
            </bidi:TabItem>
            <bidi:TabItem Header="تبويبة رقم 2" Style="{StaticResource BigArabicTabItem}">
              <bidi:TabItem.Content>
                <bidi:TextBlock Text="تبويبة محتوى رقم 2" Style="{StaticResource BigArabicText}"/>
              </bidi:TabItem.Content>
            </bidi:TabItem>
            <bidi:TabItem Header="تبويبة رقم 3"  Style="{StaticResource BigArabicTabItem}">
              <bidi:TabItem.Content>
                <bidi:TextBlock Text="تبويبة محتوى رقم 3" Style="{StaticResource BigArabicText}"/>
              </bidi:TabItem.Content>
            </bidi:TabItem>
          </controls:TabControl>

          <controls:TabControl TabStripPlacement="Top" TabNavigation="Cycle" HorizontalAlignment="Right" Grid.Row="9" Grid.Column="0">
            <controls:TabItem Header="تبويبة رقم 1"  Style="{StaticResource BigTabItem}">
              <controls:TabItem.Content>
                <TextBlock Text="تبويبة محتوى رقم 1" FontSize="15"/>
              </controls:TabItem.Content>
            </controls:TabItem>
            <controls:TabItem Header="تبويبة رقم 2"  Style="{StaticResource BigTabItem}">
              <controls:TabItem.Content>
                <TextBlock Text="تبويبة محتوى رقم 2" FontSize="15"/>
              </controls:TabItem.Content>
            </controls:TabItem>
            <controls:TabItem Header="تبويبة رقم 3"  Style="{StaticResource BigTabItem}">
              <controls:TabItem.Content>
                <TextBlock Text="تبويبة محتوى رقم 3" FontSize="15"/>
              </controls:TabItem.Content>
            </controls:TabItem>
          </controls:TabControl>

          <!--TextBox-->
          <bidi:TextBox Text="مرحبا! أنا النص باللغة العربية" Grid.Row="10" Grid.Column="1"  Style="{StaticResource BigArabicTextBox}"/>
          <TextBox Text="مرحبا! أنا النص باللغة العربية" Grid.Row="10" Grid.Column="0" FontSize="15"/>

          <!--TextBlock-->
          <bidi:TextBox x:Name="txtTextBlockText" Text="مرحبا! أنا النص باللغة العربية" FlowDirection="RightToLeft" Grid.Row="11" Grid.Column="2"  Style="{StaticResource BigArabicTextBox}"/>
          <bidi:TextBlock Text="{Binding Path=Text, ElementName=txtTextBlockText}" Grid.Row="11" Grid.Column="1" Style="{StaticResource BigArabicText}"/>
          <TextBlock Text="{Binding Path=Text, ElementName=txtTextBlockText}" Grid.Row="11" Grid.Column="0"/>

          <!--ToggleButton-->
          <bidi:TextBox x:Name="txtToggleButtonText" Text="مرحبا! أنا النص باللغة العربية" FlowDirection="RightToLeft" Grid.Row="12" Grid.Column="2"  Style="{StaticResource BigArabicTextBox}"/>
          <bidi:ToggleButton Content="{Binding Path=Text, ElementName=txtToggleButtonText}" Grid.Row="12" Grid.Column="1" Style="{StaticResource BigArabicToggleButton}"/>
          <ToggleButton Content="{Binding Path=Text, ElementName=txtToggleButtonText}" Grid.Row="12" Grid.Column="0" FontSize="15"/>

          <!--DataGrid-->
          <bidi:Button Content="ملء البيانات" x:Name="btnFillDataGrids" Width="100" Height="25" Grid.Row="13" Grid.Column="02" Click="btnFillDataGrids_Click"  Style="{StaticResource BigArabicButton}"/>
          <bidi:DataGrid x:Name="grdBidiDataGrid" FlowDirection="RightToLeft" VerticalScrollBarVisibility="Auto" AutoGenerateColumns="True" Grid.Row="13" Grid.Column="1"/>
          <data:DataGrid x:Name="grdDataGrid" VerticalScrollBarVisibility="Auto" AutoGenerateColumns="True" Grid.Row="13" Grid.Column="0"/>
        </Grid>

      </StackPanel>

    </ScrollViewer>
    <!--</twilightBlue:TwilightBlueTheme>-->

  </Grid>
</navigation:Page>
